import request from "@/utils/request.js";

const api_prefix = "/goods";

export function hotList(pageNo, pageSize) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/front/hot/list/${pageNo}/${pageSize}`,
    method: "GET",
  });
}

export function searchGoodsData(pageNo, pageSize,goodId,msg) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/search/goods/front/${pageNo}/${pageSize}/${goodId}/${msg}`,
    method: "GET",
  });
}

export function search(param, selectMsg) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/search/${param}/${selectMsg}`,
    method: "GET",
  });
}

export function getGoodsDetail(id) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/detail/${id}`,
    method: "GET",
  });
}

export function getGoodsList(ids,orderId) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/get/goodId/${ids}/${orderId}`,
    method: "GET",
  });
}

export function recommendList(pageNo, pageSize) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/front/recommend/list/${pageNo}/${pageSize}`,
    method: "GET",
  });
}

export function getIndexImage() {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/index/image`,
    method: "GET"
  });
}

export function getGoodsData(pageNo, pageSize, categoryName) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/category/list/${pageNo}/${pageSize}/${categoryName}`,
    method: "GET",
  });
}

export function getLikeGoodsData(pageNo, pageSize) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/like/list/${pageNo}/${pageSize}`,
    method: "GET",
  });
}
